<extend name="Public:base"/>
<block name="left">
    <ul class=" ">
        <li><a href="{:U('Person/auth')}">实名认证</a></li>
        <li><a href="">照片认证</a></li>
        <li><a href="">身份认证</a></li>
        <li><a href="{:U('Person/updatepwd')}">修改登录密码</a></li>
        <li><a href="{:U('Person/change_pwdtrade')}">修改交易密码</a></li>
        <li><a href="{:U('Person/forgot_pwdtrade')}">找回交易密码</a></li>
        <li><a href="">设置双重验证</a></li>
        <li><a href="">手机绑定</a></li>
        <li><a href="">邮箱验证</a></li>
        <li><a href="">邮件通知</a></li>
        <li><a href="{:U('Person/set_pwdtrade')}">交易密码设置</a></li>
    </ul>
</block>

<block name="right">
<br><br><br>
		<form action="">
		<div  class="col-xs-12">

			<div class="setting-right-wrap wrap-boxes settings" id="avatar_main">
			<div>头像：</div>
            <input name="face" id="face" value="" type="file">  
            <div id="show_photo" style="border:1px solid #f7f7f7;margin:20px 0 0">
            <img src="
            <if condition="$face neq ''">
            __ROOT__{$face}
            <else />
            __PUBLIC__/images/avatar.jpg
            </if>
            " alt="头像" id="faceimg">
            </div>
        </div>
		</div>
		<div  class="col-xs-10">
			<label class="label-name" for="nick">昵称</label>
            <input id="nickname" class="rlf-input rlf-input-nick" placeholder="请输入昵称." value="{$userinfos.nickname}" data-validate="nick" autocomplete="off" name="nickname" type="text">
		</div>
		<div  class="col-xs-12">
			<label class="label">性别</label>
                    <label>
                        <input name="sex" value="0" hidefocus="true" autocomplete="off" <if condition="$userinfos['sex'] eq 0">checked="checked"</if> type="radio">
                        保密
                    </label>
                    <label>
                        <input name="sex" value="1" hidefocus="true" autocomplete="off" <if condition="$userinfos['sex'] eq 1">checked="checked"</if>  type="radio">
                        男
                    </label>
                    <label>
                        <input name="sex" value="2" hidefocus="true" autocomplete="off" <if condition="$userinfos['sex'] eq 2">checked="checked"</if>  type="radio">
                        女
                    </label>

		</div>
		<div  class="col-xs-12">
			<div>生日：</div>

		</div>
		<div  class="col-xs-12">
			     <label class="label-name" for="province-select">城市</label>
                    <span id="city_area">
                        <select class="prov"><option selected="selected" value="北京">北京</option><option value="天津">天津</option><option value="河北">河北</option><option value="山西">山西</option><option value="内蒙古">内蒙古</option><option value="辽宁">辽宁</option><option value="吉林">吉林</option><option value="黑龙江">黑龙江</option><option value="上海">上海</option><option value="江苏">江苏</option><option value="浙江">浙江</option><option value="安徽">安徽</option><option value="福建">福建</option><option value="江西">江西</option><option value="山东">山东</option><option value="河南">河南</option><option value="湖北">湖北</option><option value="湖南">湖南</option><option value="广东">广东</option><option value="广西">广西</option><option value="海南">海南</option><option value="重庆">重庆</option><option value="四川">四川</option><option value="贵州">贵州</option><option value="云南">云南</option><option value="西藏">西藏</option><option value="陕西">陕西</option><option value="甘肃">甘肃</option><option value="青海">青海</option><option value="宁夏">宁夏</option><option value="新疆">新疆</option><option value="香港">香港</option><option value="澳门">澳门</option><option value="台湾">台湾</option><option value="国外">国外</option></select> 
                        <select class="city"><option selected="selected" value="东城区">东城区</option><option value="西城区">西城区</option><option value="崇文区">崇文区</option><option value="宣武区">宣武区</option><option value="朝阳区">朝阳区</option><option value="丰台区">丰台区</option><option value="石景山区">石景山区</option><option value="海淀区">海淀区</option><option value="门头沟区">门头沟区</option><option value="房山区">房山区</option><option value="通州区">通州区</option><option value="顺义区">顺义区</option><option value="昌平区">昌平区</option><option value="大兴区">大兴区</option><option value="平谷区">平谷区</option><option value="怀柔区">怀柔区</option><option value="密云县">密云县</option><option value="延庆县">延庆县</option></select>
                        <select style="display: none;" class="dist" disabled="disabled"></select>
                    </span>
		</div>
		<div  class="col-xs-12">
			<label class="label-name" for="nick">职业</label>
            <input id="nickname" class="rlf-input rlf-input-nick" placeholder="请输入职业." value="{$userinfos.nickname}" data-validate="nick" autocomplete="off" name="nickname" type="text">
		</div>
		<div  class="col-xs-12">
			<label class="label-name label_signature" for="aboutme">个性签名</label>
                    <textarea class="textarea textarea_signature" rows="5" cols="30" id="signature">{$userinfos.intro}</textarea>
		</div>


		<div><button>保存</button></div>

		</form>
		<div></div>


<!-- 城市选择 -->
<script type="text/javascript">
    $('select[name=job]').val('{$userinfos.job}');
    $(function() {
        $("#city_area").citySelect({
            prov: "{$prov}",
            city: "{$city}",
            dist: "{$dist}",
            nodata: "none",
            url: "__PUBLIC__/style/city.min.js"
        });
        $("#btn_submit").click(function() {
            var nickname = $("#nickname").val();
            var job = $("#job").val();
            var sex = $("input[name=sex]:checked").val();
            var signature = $("#signature").val();
            var area = '';
            $("#city_area").children("select").each(function() {
                area += $(this).val() + ",";
            })
            checkBefore('#btn_submit');
            $.post("__CONTROLLER__/updateInfo", {nickname: nickname, job: job, area: area, sex: sex, signature: signature}, function(data) {
                $("#signed_textarea").val(signature);
                $(".job-title").html(job);
                $(".myname").html(nickname);
                checkAfter('#btn_submit');
                showSuccessTip('资料修改成功！');
            }, "json")
        })
    })

</script>
	
</block>
